/*
 * Class NPCDialogue
 *
 * Version 1.0
 *
 * Saturday 7 December, 2008
 *
 * Created by Prima
 */

package palidino76.rs2.player.dialogue;

import palidino76.rs2.*;
import palidino76.rs2.npcs.*;
import palidino76.rs2.player.*;
import palidino76.rs2.Engine;
import palidino76.rs2.util.Misc;
import palidino76.rs2.player.combat.PlayerSlayer;

public class NPCDialogue {

	/**
	 * Constructor
	 */
	public NPCDialogue(Player p) {
		this.p = p;
	}

	public void NPCDialogue(Player p) {
		PlayerSlayer playSlay = new PlayerSlayer(p);
	    int k = p.skillLvl[10];
	    NPC n = Server.engine.npcs[p.clickId];

		switch (p.NpcDialogue) {

 ///////* Vannaka *///////
	case 1597:
	    p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 1597, 241, 2);
        p.frames.setString(p, "Vannaka", 241, 3);
        p.frames.setString(p, "Hello "+Misc.optimizeText(p.username)+".", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	break;
	case 1598:
		p.frames.setString(p, "Can you assign me a slayer task?", 228, 2);
		p.frames.setString(p, "Nevermind I forgot.", 228, 3);
		p.frames.showChatboxInterface(p, 228);
	break;
	case 1599:
	if (!p.slayerTask) {
		for (int i = 0; i < p.slayerArray.length; i++) {
				p.slayerAmount = playSlay.getRandom(p.slayerArray[i]);
		}
			playSlay.setSlayerAmount(p.slayerAmount);
			playSlay.setSlayerTask(true);
			p.frames.showChatboxInterface(p, 241);
			p.frames.animateInterfaceId(p, 9847, 241, 2);
			p.frames.setNPCId(p, 1597, 241, 2);
			p.frames.setString(p, "Vannaka", 241, 3);
			p.frames.setString(p, "Your task is to kill "+p.slayerAmount+" "+Server.engine.getNPCName(playSlay.getRandomSlayer())+".", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
	} else {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 1597, 241, 2);
        p.frames.setString(p, "Vannaka", 241, 3);
        p.frames.setString(p, "Please finish your current slayer task first.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
////////* Archaeologist */////////
		case 1918:
	if (p.q1 == 0) {
	p.frames.showChatboxInterface(p, 241);
                  p.frames.animateInterfaceId(p, 9827, 241, 2);
                  p.frames.setNPCId(p, 1918, 241, 2);
                  p.frames.setString(p, "Archaeologist", 241, 3);
                  p.frames.setString(p, "Get me a Rune Scimitar.", 241, 4);
	p.frames.setString(p, "<col=FFFF00>The Beginning", 274, 26);
	p.q1 = 1;
	}
	 if (p.q1 == 1  && Engine.playerItems.HasItemAmount(p, 1333, 1)) {
	p.frames.showChatboxInterface(p, 241);
                  p.frames.animateInterfaceId(p, 9827, 241, 2);
                  p.frames.setNPCId(p, 1918, 241, 2);
                  p.frames.setString(p, "Archaeologist", 241, 3);
                  p.frames.setString(p, "Thanks alot buddy!", 241, 4);
	p.frames.sendMessage(p, "You have completed The Beginning!");
	p.frames.setString(p, "<col=33FF33>The Beginning", 274, 26);
	Engine.playerItems.deleteItem(p, 1333, 1);
	p.frames.showInterface(p, 276);
	p.frames.setString(p, "Congratulations", 276, 2);
	p.frames.setString(p, "You have completed, The Beginning Quest", 276, 3);
	p.q1 = 15;
	break;
	}
break;

 ///////* Men *///////

		case 1: /* Man */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 1, 241, 2);
                	p.frames.setString(p, "Man", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+".", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2: /* Man */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2, 241, 2);
                	p.frames.setString(p, "Man", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+".", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 3: /* Man */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 3, 241, 2);
                	p.frames.setString(p, "Man", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+".", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;


 ///////* Women *///////

		case 4: /* Woman */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 4, 241, 2);
                	p.frames.setString(p, "Man", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+".", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 5: /* Woman */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 5, 241, 2);
                	p.frames.setString(p, "Man", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+".", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

 ///////* Hans *///////

		case 10: /* Hans */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 0, 241, 2);
                	p.frames.setString(p, "Hans", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+", welcome to Lumbridge.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

//////* Gee *////////
		case 2237:
   	p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2237, 241, 2);
                	p.frames.setString(p, "Gee", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+" I don't have any tasks for you currently.", 241, 4);
	p.NpcDialogue = 0;
	p.NpcDialogueSend = true;
	n.requestFaceCoords(p.absX, p.absY);
	break;

/////////* BH BANK *////////
		case 6538:
	p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 6538, 241, 2);
                	p.frames.setString(p, "Banker", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+", Welcome to my Bank.", 241, 4);
	p.NpcDialogue = 0;
	p.NpcDialogueSend = true;
	break;

////////* Bob *////////
		case 519:
	p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 519, 241, 2);
                	p.frames.setString(p, "Bob", 241, 3);
                	p.frames.setString(p, "Hello "+p.username+", Welcome to my Skillcape Shop.", 241, 4);
	p.NpcDialogue = 0;
	p.NpcDialogueSend = true;
	break;
	
 ///////* Lumbridge Guide *///////

		case 2244: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "Hello there "+p.username+", I am the Lumbridge Guide.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2245: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "Do you need to know any information?.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2246: /* Lumbridge Guide */
			p.frames.setString(p, "Where am I?", 230, 2);
			p.frames.setString(p, "How can I make money?", 230, 3);
			p.frames.setString(p, "No, I don't have any questions thanks.", 230, 4);
			p.frames.showChatboxInterface(p, 230);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2247: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "You are in the great City of Lumbridge.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2248: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "Everyone in the World started their adventures here.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2249: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 243);
                	p.frames.animateInterfaceId(p, 9847, 243, 2);
                	p.frames.setNPCId(p, 2244, 243, 2);
                	p.frames.setString(p, "Lumbridge Guide", 244, 3);
                	p.frames.setString(p, "There are many ways in which you can make money, such", 243, 4);
                	p.frames.setString(p, "as killing monsters, or battling other players in the", 243, 5);
                	p.frames.setString(p, "wilderness for their items.", 243, 6);
			break;

		case 2250: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "such as killing monsters, or battling other players in", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2251: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "the wilderness for their items.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 2252: /* Lumbridge Guide */
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 2244, 241, 2);
                	p.frames.setString(p, "Lumbridge Guide", 241, 3);
                	p.frames.setString(p, "Is there anything else you would like to know, "+p.username+"?", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;
			
			
 ///////* Grumpy Old Man *///////
			
	case 1696:
if (p.skillLvl[5] < 43 && p.skillLvl[18] < 35 && p.skillLvl[17] < 50) {
	p.frames.showChatboxInterface(p, 241);
	p.frames.animateInterfaceId(p, 9847, 241, 2);
	p.frames.setNPCId(p, 1696, 241, 2);
	p.frames.setString(p, "Grumpy Old-Man", 241, 3);
	p.frames.setString(p, "Leave me alone I'm busy. Come back another time.", 241, 4);
	p.NpcDialogue = 0;
	p.NpcDialogueSend = true;
	n.requestFaceCoords(p.absX, p.absY);
} else if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49 && p.StraightChamp == 0) {
	p.frames.showChatboxInterface(p, 241);
	p.frames.animateInterfaceId(p, 9847, 241, 2);
	p.frames.setNPCId(p, 1696, 241, 2);
	p.frames.setString(p, "Grumpy Old-Man", 241, 3);
	p.frames.setString(p, "Hello there young sir.", 241, 4);
	p.NpcDialogue = 0;
	p.NpcDialogueSend = true;
	n.requestFaceCoords(p.absX, p.absY);
} else if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49 && p.StraightChamp == 50) {
	p.frames.showChatboxInterface(p, 241);
	p.frames.animateInterfaceId(p, 9847, 241, 2);
	p.frames.setNPCId(p, 1696, 241, 2);
	p.frames.setString(p, "Grumpy Old-Man", 241, 3);
	p.frames.setString(p, "Go speak to Gjuki Sorvott IV in the Champions Guild.", 241, 4);
	p.NpcDialogue = 0;
	p.NpcDialogueSend = true;
	n.requestFaceCoords(p.absX, p.absY);
}
	break;
	case 1697:
	if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49 && p.StraightChamp == 0) {
		p.frames.setString(p, "What are you doing in Edgeville?", 233, 2);
		p.frames.setString(p, "", 233, 3);
		p.frames.setString(p, "", 233, 4);
		p.frames.setString(p, "", 233, 5);
		p.frames.showChatboxInterface(p, 233);
	}
	break;
	case 1698:
	if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49 && p.StraightChamp == 0) {
		p.frames.showChatboxInterface(p, 241);
		p.frames.animateInterfaceId(p, 9847, 241, 2);
		p.frames.setNPCId(p, 1696, 241, 2);
		p.frames.setString(p, "Grumpy Old-Man", 241, 3);
		p.frames.setString(p, "I am from the Champions Guild looking for recruits.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 1699:
	if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49 && p.StraightChamp == 0) {
		p.frames.showChatboxInterface(p, 241);
		p.frames.animateInterfaceId(p, 9847, 241, 2);
		p.frames.setNPCId(p, 1696, 241, 2);
		p.frames.setString(p, "Grumpy Old-Man", 241, 3);
		p.frames.setString(p, "Would you like to join the Champions Guild?", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 1700:
	if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49 && p.StraightChamp == 0) {
		p.frames.setString(p, "Sure.", 233, 2);
		p.frames.setString(p, "No thanks I'm a pussy.", 233, 3);
		p.frames.setString(p, "", 233, 4);
		p.frames.setString(p, "", 233, 5);
		p.frames.showChatboxInterface(p, 233);
	}
	break;
	case 1702:
		if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49) {
		p.frames.showChatboxInterface(p, 241);
		p.frames.animateInterfaceId(p, 9775, 241, 2);
		p.frames.setNPCId(p, 1696, 241, 2);
		p.frames.setString(p, "Grumpy Old-Man", 241, 3);
		p.frames.setString(p, "Oh alrighty then.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);		
	}
	break;
	case 1701:
	if (p.skillLvl[5] > 42 && p.skillLvl[18] > 34 && p.skillLvl[17] > 49) {
		p.frames.showChatboxInterface(p, 241);
		p.frames.animateInterfaceId(p, 9847, 241, 2);
		p.frames.setNPCId(p, 1696, 241, 2);
		p.frames.setString(p, "Grumpy Old-Man", 241, 3);
		p.frames.setString(p, "Go speak to King Gjuki Sorvott IV in the Champions Guild.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
		p.StraightChamp = 50;
		p.disconnected[0] = false;	
		p.frames.setString(p, "<col=FFFF00>Straight Champion", 274, 131);		
	}
	break;
///////* END OF GRUMPY OLD MAN*///////

///////* START OF KING GJUKI SORVOTT IV*///////

	case 5478:
	if (p.StraightChamp < 50) {
		p.frames.sendMessage(p, "He seems too busy to talk right now.");
	} else if (p.StraightChamp == 50) {
	   	p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Hello young adventurer.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	} else if (p.StraightChamp == 150 && Engine.playerItems.HasItemAmount(p, 4078, 1) == true) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Well done adventurer you have retrieved the key.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	} else if (p.StraightChamp > 999) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Hello young adventurer.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 5479:
	if (p.StraightChamp == 50) {
		p.frames.setString(p, "I was told to speak with you about becoming a member of this Guild.", 233, 2);//
		p.frames.setString(p, "What is this place?", 233, 3);
		p.frames.setString(p, "Who are you?", 233, 4);
		p.frames.setString(p, "Nevermind I forgot.", 233, 5);
		p.frames.showChatboxInterface(p, 233);
	} else if (p.StraightChamp == 150) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Congratulations you are now a Guild member.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	} else if (p.StraightChamp > 999) {
		p.frames.setString(p, "Do you have anything for trade?", 228, 2);
		p.frames.setString(p, "Nevermind I forgot.", 228, 3);
		p.frames.showChatboxInterface(p, 228);
	}
	break;
	case 5480:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Ahh yes you must have spoken to our oldest member Mark.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	} else if (p.StraightChamp > 999) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Yes I do, would you like to see?", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 5481:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "He's helping us get new recruits for this Guild.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	} else if (p.StraightChamp > 999) {
		p.frames.setString(p, "Yes", 228, 2);
		p.frames.setString(p, "No nevermind.", 228, 3);
		p.frames.showChatboxInterface(p, 228);
	}
	break;
	case 5482:
	if (p.StraightChamp == 50) {
		p.frames.setString(p, "What must I do to become a member of this Guild?", 228, 2);
		p.frames.setString(p, "Nevermind I forgot.", 228, 3);
		p.frames.showChatboxInterface(p, 228);
	}
	break;
	case 5483:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "You must retrieve Zealot's key somewhere in...", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 5484:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "the abandoned town of Pollnivneach.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 5485:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "But beware the town is guarded by an evil spirit...", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 5486:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "which is known to be very powerful when aggravated.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
	}
	break;
	case 5487:
	if (p.StraightChamp == 50) {
		p.frames.showChatboxInterface(p, 241);
        p.frames.animateInterfaceId(p, 9847, 241, 2);
        p.frames.setNPCId(p, 5478, 241, 2);
        p.frames.setString(p, "King Gjuki Sorvott IV", 241, 3);
        p.frames.setString(p, "Once you retrieve the key come and speak with me.", 241, 4);
		p.NpcDialogue = 0;
		p.NpcDialogueSend = true;
		n.requestFaceCoords(p.absX, p.absY);
		p.StraightChamp = 100;
		p.disconnected[0] = false;	
	}
	break;
	
///////* END OF KING GJUKI SORVOTT IV*///////

 ///////* Surgeon General Tafani *///////

		case 961:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "Hi. How can I help?", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 962:
			p.frames.setString(p, "Can you heal me?", 233, 2);
			p.frames.setString(p, "Do you see alot of injured fighters?", 233, 3);
			p.frames.setString(p, "Do you come here often?", 233, 4);
			p.frames.setString(p, "Where can I get a cape like yours?", 233, 5);
			p.frames.showChatboxInterface(p, 233);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 963: 
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "Of course!", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 964:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "You look healthy to me!", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 965:
   			p.frames.showChatboxInterface(p, 244);
                	p.frames.animateInterfaceId(p, 9847, 244, 2);
                	p.frames.setNPCId(p, 961, 244, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 244, 3);
                	p.frames.setString(p, "Yes, I do. Thankfully, we can cope with almost", 244, 4);
                	p.frames.setString(p, "anything. Jaarah really is a wonderful surgeon; his", 244, 5);
                	p.frames.setString(p, "methods are a little unorthodox, but he gets the job", 244, 6);
                	p.frames.setString(p, "done.", 244, 7);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 966:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "Of course I do, I work here!", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 967:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9840, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "You're silly!", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 968:
   			p.frames.showChatboxInterface(p, 243);
                	p.frames.animateInterfaceId(p, 9847, 243, 2);
                	p.frames.setNPCId(p, 961, 243, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 244, 3);
                	p.frames.setString(p, "Why certainly my friend. However, owning such an", 243, 4);
                	p.frames.setString(p, "item makes you part of an elite group and that privelige", 243, 5);
                	p.frames.setString(p, "will cost you 99000 coins.", 243, 6);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 969:
			p.frames.setString(p, "Sorry, that's much too pricey.", 229, 2);
			p.frames.setString(p, "Sure, not too expensive for such a magnificent cape.", 229, 3);
			p.frames.showChatboxInterface(p, 229);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			break;

		case 970:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9847, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "Wear this cape in good health, my friend.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 971:
   			p.frames.showChatboxInterface(p, 244);
                	p.frames.animateInterfaceId(p, 9847, 244, 2);
                	p.frames.setNPCId(p, 961, 244, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 244, 3);
                	p.frames.setString(p, "Well, these capes are only available for people who have", 244, 4);
                	p.frames.setString(p, "achieved a Hitpoint level of 99. You should go and train", 244, 5);
                	p.frames.setString(p, "some more and come back to me when your Hitpoints", 244, 6);
                	p.frames.setString(p, "are higher.", 244, 7);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 972:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9740, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "I'm sorry, you do not have enough space for the Skillcape.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;

		case 973:
   			p.frames.showChatboxInterface(p, 241);
                	p.frames.animateInterfaceId(p, 9740, 241, 2);
                	p.frames.setNPCId(p, 961, 241, 2);
                	p.frames.setString(p, "Surgeon General Tafani", 241, 3);
                	p.frames.setString(p, "I'm sorry, you do not have enough coins to buy the cape.", 241, 4);
			p.NpcDialogue = 0;
			p.NpcDialogueSend = true;
			n.requestFaceCoords(p.absX, p.absY);
			break;
			/////END OF SURGEON/////


		case 316: // Fish Shrimps
		    if (p.skillLvl[10] >= 1) {
			if (Engine.playerItems.HasItemAmount(p, 303, 1) == true) {
				p.fishXP = 50;
				p.fishGet = 317;
				p.fishEmote = 620;
				p.fishLvlReq = 1;
				p.fishName = "Shrimp";
				p.fishTimer = Misc.random(15 + (k / 8) - p.fishLvlReq / 4);
				p.requestAnim(p.fishEmote, 0);
			} else {
				p.frames.sendMessage(p, "You need a small fishing net to fish Shrimp.");
		    	}
		    } else {
			p.frames.sendMessage(p, "You need level 1 fishing to fish Shrimp.");
		    }
			break;

		case 313: // Fish Bass
		    if (p.skillLvl[10] > 29) {
			if (Engine.playerItems.HasItemAmount(p, 305, 1) == true) {
				p.fishXP = 110;
				p.fishGet = 363;
				p.fishEmote = 620;
				p.fishLvlReq = 29;
				p.fishName = "Bass";
				p.fishTimer = Misc.random(15 + (k / 8) - p.fishLvlReq / 4);
				p.requestAnim(p.fishEmote, 0);
			} else {
				p.frames.sendMessage(p, "You need a big fishing net to fish Bass.");
			}
		    } else {
			p.frames.sendMessage(p, "You need level 30 fishing to fish Bass.");
		    }
			break;


		case 312: // Fish Lobsters
		    if (p.skillLvl[10] > 39) {
			if (Engine.playerItems.HasItemAmount(p, 301, 1) == true) {
				p.fishXP = 300;
				p.fishGet = 377;
				p.fishEmote = 619;
				p.fishLvlReq = 40;
				p.fishName = "Lobster";
				p.fishTimer = Misc.random(15 + (k / 8) - p.fishLvlReq / 4);
				p.requestAnim(p.fishEmote, 0);
			} else {
				p.frames.sendMessage(p, "You need a lobster pot to fish Lobsters.");
			}
		    } else {
			p.frames.sendMessage(p, "You need level 40 fishing to fish Lobsters.");
		    }
			break;

		case 326: // Fish Trout
		    if (p.skillLvl[10] > 14) {
			if (Engine.playerItems.HasItemAmount(p, 307, 1) == true) {
				p.fishXP = 150;
				p.fishGet = 335;
				p.fishEmote = 622;
				p.fishName = "Trout";
				p.fishTimer = Misc.random(15 + (k / 8) - p.fishLvlReq / 4);
				p.requestAnim(p.fishEmote, 0);
			} else {
				p.frames.sendMessage(p, "You need a fishing rod to fish Trout.");
			}
		    } else {
			p.frames.sendMessage(p, "You need level 15 fishing to fish Trout.");
		    }
			break;

		case 322: // Fish Shark
		    if (p.skillLvl[10] > 74) {
			if (Engine.playerItems.HasItemAmount(p, 311, 1) == true) {
				p.fishXP = 500;
				p.fishGet = 383;
				p.fishEmote = 618;
				p.fishName = "Shark";
				p.fishTimer = Misc.random(15 + (k / 8) - p.fishLvlReq / 4);
				p.requestAnim(p.fishEmote, 0);
			} else {
				p.frames.sendMessage(p, "You need a harpoon to fish here.");
			}
		    } else {
			p.frames.sendMessage(p, "You need level 75 fishing to fish Sharks.");
		    }
			break;

		case 323: // Fish Manta
		    if (p.skillLvl[10] > 89) {
			if(Engine.playerItems.HasItemAmount(p, 311, 1) == true) {
				p.fishXP = 1000;
				p.fishGet = 389;
				p.fishEmote = 618;
				p.fishLvlReq = 90;
				p.fishName = "Manta ray";
				p.fishTimer = Misc.random(15 + (k / 8) - p.fishLvlReq / 4);
				p.requestAnim(p.fishEmote, 0);
			} else {
				p.frames.sendMessage(p, "You need a harpoon to fish Manta rays.");
			}
		    } else {
			p.frames.sendMessage(p, "You need level 90 fishing to fish Manta rays.");
		    }
			break;


		case 44: // Bank
			p.openBank();
			break;
		}
	}


	Player p;
}